Skip to content

feat(atemschutz): Strahlenschutzüberwachung for a Strahlenschutztrupp - #997

Draft
ChrArlt wants to merge 3 commits into
mainfrom
feat/strahlenschutz-trupp
Draft

ChrArlt wants to merge 3 commits into
mainfrom
feat/strahlenschutz-trupp

Conversation

@ChrArlt

@ChrArlt ChrArlt commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #994. Stacked on #996 (both change the Trupp-Typ). Merge #996 first; this PR then retargets to main.

What changes

A Trupp-Typ can be marked Strahlenschutz in the Stammdaten. The Trupp copies the flag when it is registered, following the copy-at-use rule in AGENTS.md. Every Einsatzkraft in it then carries a record:

  • the numbers of OSL-Dosimeter, Alarmdosimeter, Maske and PA;
  • the Alarmdosimeter Ablesewert, as a value plus unit. mSv is the default and µSv can be picked. The value is kept as read, never converted.

Atemschutz tab

  • A Strahlenschutztrupp's row gets a Strahlenschutz button and an amber hint for what is still owed: "Dosimeter-Nr. fehlen", or "Ablesewert offen".
  • IM EINSATZ is held back until both dosimeters of every crew member are numbered or confirmed as nicht vorhanden. Maske and PA stay optional.
  • The dialog has one block per crew member. Nicht vorhanden asks first, because it breaks the documentation chain. It writes an ACHTUNG … line to the ETB, and the Bericht prints it dark red.
  • The Ablesewert can come in after Abnehmen, since the Dekon-Platz reports late. Each entry is its own ETB line with its own time.

Closing the Einsatz is refused while a started Strahlenschutztrupp still owes a reading. It is not merely warned about, because a closed Einsatz is read-only. The refusal names the Trupps, and its button leads to the Atemschutzüberwachung. The domain refuses too, since a client's close reaches the host as a command.

Bericht (PDF): one line per crew member with the numbers and the Ablesewert, offen or nicht vorhanden.

Schema, sync, trust boundaries

  • Incident schema V46.
    • New columns: scba_trupps.radiation_monitoring, plus has_radiation, the number columns, dose_value and dose_unit on scba_trupp_members. All are declared in SchemaGuard.ExpectedColumns.
    • Older files read back with no Trupp under the Überwachung. docs/samples/uebung.lagebuch was regenerated.
  • Stammdaten: radiationMonitoring on a Trupp-Typ, covering JSON, md_trupp_types, the editor column, docs/master-data.example.json, the round-trip fixture and docs/master-data.md. There is no automatic migration: which Trupp-Typ is under the Überwachung is the brigade's choice to tick.
  • Sync protocol 45, floor 45.
    • A client may send recordScbaRadiation.
    • addScbaTrupp carries radiationMonitoring. A host at 44 would drop it, registering the Trupp outside the Überwachung and letting the Einsatz close without its readings.
  • Untrusted input:
    • A handed-over .lagebuch and a host snapshot are read leniently through RadiationRecord.FromUntrusted. A number over 50 characters is cut, and an out-of-range reading or unknown unit is dropped, never fatal.
    • A client's command goes through the checking constructor and is refused.
    • Tests replay each case.

Screenshots

Atemschutz: before, and after with Dosimeter-Nr. fehlen and IM EINSATZ held back.

Atemschutz before
Atemschutz after

Strahlenschutz dialog: numbers, Ablesewert with mSv, and the confirmation for nicht vorhanden.

Strahlenschutz dialog

Stammdaten → Trupp-Typen: the new STRAHLENSCHUTZ column.

Trupp-Typen before
Trupp-Typen after

Verification

  • Clean Release build on LageBuch.Desktop.slnf (clean, rm bin/obj, restore --locked-mode, build, test): 0 warnings.
    • Everything passes except the four symlink tests (AttachmentTempPathsTests ×3, IncidentFileStoreTests ×1). They test code this PR does not touch and fail on this Windows machine because it lacks the symlink privilege; they fail on main there too.
  • Mutation testing on changed lines, run locally like CI's mutate-diff: Domain 97 %, Documents 100 %, Persistence 100 %, AppLogic 96.8 %.
    • The three AppLogic survivors are First→FirstOrDefault swaps on Trupps and members that always exist.
    • Local note: Stryker's {a..b} span globs match nothing on Windows, so whole changed files were mutated and scored on changed lines.
  • New tests:
    • Domain: rules, refusals, limits, lenient reading.
    • Persistence: round trip, hostile file, V45 file.
    • Sync: commands over the wire, hostile command, snapshot.
    • AppLogic: form, row, dialog, ETB wording, close refusal.
    • Documents: PDF lines and style.
    • Acceptance: row, dialog, editor column, and the overlay keyboard contract.
  • make codeql was not run: the script supports Linux/macOS only. The diff was checked by hand against the AGENTS.md query table.

🤖 Generated with Claude Code

ChrArlt and others added 3 commits November 20, 2026 09:53
A CSA-Trupp is called "CSA-Trupp 1" on the radio, but the form only
offered a free-text Funkrufname, so crews typed "1" and the row read
"1 · CSA-Trupp".

A Trupp-Typ can now be marked "Funkrufname aus Nummer" in the
Stammdaten. The Atemschutz form then shows NUMMER in place of
FUNKRUFNAME, suggests the next number free for that Trupp-Art, refuses
one already in use, and copies "CSA-Trupp 1" into the Trupp's own
Funkrufname, so the grid, banners, ETB and Bericht all use it. The
display name drops the Trupp-Art when the Funkrufname already names it.

The flag is a Stammdaten setting rather than a check on the name
(#398). A one-time migration sets it on an existing CSA-Trupp, and a
pre-#398 JSON backup translates the same way. /masterdata carries the
optional field, so the protocol rises to 44 with the floor at 40.

Closes #995

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Christian Arlt <[email protected]>
The AppLogic mutation run left seven mutants alive on #995's lines: that
a number typed by hand survives a Trupp registered elsewhere, that a
suggestion keeps moving, that switching the Trupp-Art forgets a typed
number, and that pressing announces the number error. Tests now cover
each. Two lines were redundant and go: a second ErrorSummary
notification, and resetting the typed-number flag after AddTrupp, which
clearing the Trupp-Art already does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Christian Arlt <[email protected]>
A Trupp-Typ can be marked "Strahlenschutz" in the Stammdaten. A Trupp
of that type copies the flag at registration, and every Einsatzkraft
in it carries a record: OSL-Dosimeter, Alarmdosimeter, Maske and PA
numbers, and the Alarmdosimeter's Ablesewert in mSv (default) or µSv,
kept as read and never converted.

- The row offers STRAHLENSCHUTZ, a dialog with one block per crew
  member, and an amber hint for what is still owed.
- IM EINSATZ waits until both dosimeters of everyone are numbered or
  confirmed as nicht vorhanden.
- "Nicht vorhanden" asks first, because it breaks the documentation
  chain, and writes an ACHTUNG line to the ETB. The Bericht prints it
  dark red.
- The Ablesewert can follow after Abnehmen, since the Dekon-Platz
  reports late. Closing the Einsatz is refused, in the view model and
  in the domain, until every started Strahlenschutztrupp has one or a
  confirmed missing dosimeter per member.

The incident schema moves to V46 (declared in SchemaGuard). A handed-
over file and a host's snapshot are read leniently through
RadiationRecord.FromUntrusted; a client's command is checked strictly.
Protocol 45 adds recordScbaRadiation and radiationMonitoring on
addScbaTrupp, which a host at 44 would drop, so the floor rises to 45.

Closes #994

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Christian Arlt <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@DeepDiver1975
DeepDiver1975 marked this pull request as draft November 24, 2026 19:25
Base automatically changed from feat/csa-trupp-number to main November 24, 2026 20:48

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Atemschutz: Strahlenschutzüberwachung for a Strahlenschutztrupp (OSL-Dosimeter, Alarmdosimeter, Maske, PA, Ablesewert)

1 participant